﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Shared/Shared.master"
    CodeFile="clsAdd.aspx.cs" Inherits="ltMan_news_clsAdd" %>

<asp:Content ID="C1" ContentPlaceHolderID="head" runat="Server">
    <style>
        .container {
            overflow: auto;
        }
    </style>
</asp:Content>
<asp:Content ID="C2" ContentPlaceHolderID="CPH1" runat="Server">
    <telerik:RadAjaxManagerProxy runat="server" ID="proxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="mainPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadCodeBlock runat="server">
        <script>
            var comboBox1, tree1;
            function nodeClicking(sender, args) {
                setSelectedNode(comboBox1, args.get_node());
            }
            function setSelectedNode(comboBox, node) {
                comboBox.set_text(node.get_text());
                comboBox.set_value(node.get_value());
                comboBox.trackChanges();
                comboBox.get_items().getItem(0).set_text(node.get_text());
                comboBox.get_items().getItem(0).set_value(node.get_value());
                comboBox.commitChanges();
                comboBox.hideDropDown();
            }
            Sys.Application.add_load(function () {
                comboBox1 = $find("<%=clsParent.ClientID %>"), tree1 = $find('<%=clsParent.Items[0].FindControl("RadTreeView1").ClientID %>');
                setSelectedNode(comboBox1, tree1.get_selectedNode() || tree1.get_nodes().getNode(0));
            });
        </script>
    </telerik:RadCodeBlock>
    <asp:Panel ID="mainPanel" runat="server" class="pad10">
        <telerikex:InfoPanel runat="server" ID="infoPanel" />
        <table class="stab">
            <tr>
                <td>
                    类别名称：
                </td>
                <td>
                    <telerik:RadTextBox runat="server" ID="clsName" Width="215" MaxLength="30" EmptyMessage="输入名称" /><asp:RequiredFieldValidator
                        runat="server" ID="r1" ControlToValidate="clsName" ErrorMessage="请输入名称" Display="None" />
                </td>
            </tr>
            <tr>
                <td>
                    所属类别：
                </td>
                <td>
                    <telerik:RadComboBox runat="server" ID="clsParent" Width="218">
                        <ItemTemplate>
                            <telerik:RadTreeView runat="server" ID="RadTreeView1" DataTextField="classname" DataValueField="class_id"
                                DataFieldID="class_id" DataFieldParentID="father_id" OnClientNodeClicking="nodeClicking" />
                        </ItemTemplate>
                        <Items>
                            <telerik:RadComboBoxItem Text="" />
                        </Items>
                    </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td>
                    图 片：
                </td>
                <td>
                    <telerikEx:AsyncUploadEx ID="clsPic" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="2" class="ta-center">
                    <telerik:RadButton ID="RadSave" runat="server" Text="保存" ToolTip="保存" Icon-PrimaryIconCssClass="icon-save"
                        OnClick="RadSave_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>